package com.design.patterns.list.decorator;

/**
 * @author Wangzhiwen
 */
public class DecoratorClient {

    public static void main(String[] args) {
        // 被装饰者
        Drink drink = new LongBlack();
        print(drink);

        // 装饰者，加强
        drink = new Milk(drink);
        print(drink);

        drink = new Chocolate(drink);
        print(drink);

        drink = new Chocolate(drink);
        print(drink);
    }

    private static void print(Drink drink){
        System.out.println(drink.getName());
        System.out.println(drink.cost());
    }

}
